﻿@model  P2PWeb.Models.Account
@{
    ViewBag.Title = "用户详细信息";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@using P2PWeb.Controllers;
@using P2PWeb.Common
@using P2PWeb;

<script type="text/javascript" src="@Url.Content("~/Scripts/app/AccountDetail.js")"></script>
<link href="@Url.Content("~/Content/account.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/myBorrows.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/AccountDetail.css")" rel="stylesheet" type="text/css" />
<script  src="@Url.Content("~/scripts/app/citys.js")"  type="text/javascript" ></script>

<div class="main_loan">
    <div class="main_loan_top"></div>
    <div class="main_loan_content clearfjx">
        @{Html.RenderPartial("LeftMenus");}
        <div class="loan_content">
            <div class="inner">
                <div class="breadcrumbs rel">
                    <p>
                        <strong class="gtlt">&gt;&gt;</strong><span class="lay">账户首页</span>
                        <strong class="gtlt">&gt;&gt;</strong><span class="lay cur">用户详情</span>
                    </p>
                </div>
            </div>
            @using (Html.BeginForm("ChangeAccountAuthenticationState", "AccountManager"))
            {
                @Html.AntiForgeryToken()
                @Html.HiddenFor(m => m.ID)
                <div class="loan_box mt30">
                    <div class="loan_box">
                        <div class="mt30">
                            <table>
                                <tr>
                                    <td colspan="6" class="catelog">账户信息</td>
                                </tr>
                                <tr>
                                    <td>账户名称:</td>
                                    <td>@Model.Email</td>
                                    <td>姓名:</td>
                                    <td>@(Model.Name)</td>
                                    <td>账户状态:</td>
                                    <td>@(((AccountState)Model.Status).GetDisplayName())</td>
                                </tr>
                                <tr>
                                    <td colspan="6" class="catelog">个人基本信息</td>
                                </tr>
                                @if (Model.AccountInfo != null)
                                {
                                    <tr>
                                        <td>性别:</td>
                                        <td>@(Model.AccountInfo == null ? "没有填写" : ((SexType)Model.AccountInfo.Sex.GetValueOrDefault()).GetDisplayName())</td>
                                        <td>年龄:</td>
                                        <td>@(Model.AccountInfo == null ? "没有填写" : Model.AccountInfo.Age.GetValueOrDefault() + "岁")</td>
                                        <td>婚姻状况:</td>
                                        <td>@(Model.AccountInfo == null ? "没有填写" : ((MaritalType)Model.AccountInfo.Marital.GetValueOrDefault()).GetDisplayName())</td>
                                    </tr>
                                    <tr>
                                        <td>最高学历:</td>
                                        <td>@(Model.AccountInfo == null ? "没有填写" : ((EducationType)Model.AccountInfo.Education.GetValueOrDefault()).GetDisplayName())</td>
                                        <td>房产情况:</td>
                                        <td>@(Model.AccountInfo == null ? "没有填写" : ((HouseInfoType)Model.AccountInfo.Property.GetValueOrDefault()).GetDisplayName())</td>
                                        <td>信用卡最高额度:</td>
                                        <td>@(Model.AccountInfo == null ? "没有填写" : Model.AccountInfo.CreditQuota.GetValueOrDefault().CustomFormatN())</td>
                                    </tr>
                                    <tr>
                                        <td>户籍地址:
                                        </td>
                                        <td colspan="5" id="accountInfoAddress">
                                            @if (Model.AccountInfo == null)
                                            {
                                                @Html.Raw("没有填写")
                                            }
                                            else
                                            {
                                                @Html.HiddenFor(m => m.AccountInfo.ProvincialID)
                                                @Html.HiddenFor(m => m.AccountInfo.CountyID)
                                                @Html.HiddenFor(m => m.AccountInfo.CityID)
                                                @Html.HiddenFor(m => m.AccountInfo.AreaName)
                                            }
                                        </td>
                                    </tr>
                                }
                                else
                                {
                                    <tr>
                                        <td colspan="6">没有填写</td>
                                    </tr>
                                }
                                <tr>
                                    <td colspan="6" class="catelog">工作单位信息
                                    </td>
                                </tr>
                                @if (Model.WorkInfo != null)
                                {
                                    <tr>
                                        <td>工作单位全称:</td>
                                        <td colspan="2">@(Model.WorkInfo == null ? "没有填写" : Model.WorkInfo.CompanyName)</td>
                                                                            <td>工作单位电话:</td>
                                        <td colspan="2">@(Model.WorkInfo == null ? "没有填写" : Model.WorkInfo.Phone)</td>

                                    </tr>
                                    <tr>
                                        <td>单位性质:</td>
                                        <td colspan="2">@(Model.WorkInfo == null ? "没有填写" : ((CampanyType)Model.WorkInfo.CompanyType.GetValueOrDefault()).GetDisplayName())</td>
                                    <td>入职时间:</td>
                                        <td colspan="2">@(Model.WorkInfo == null ? "没有填写" : Model.WorkInfo.WorkDate.GetValueOrDefault().ToString("yyyy-MM-dd"))</td>
                                        
                                    </tr>
                                    <tr>
                                        <td>所在部门:</td>
                                        <td colspan="2">@(Model.WorkInfo == null ? "没有填写" : Model.WorkInfo.Department)</td>
                                        <td>担任职务:</td>
                                        <td colspan="2">@(Model.WorkInfo == null ? "没有填写" : Model.WorkInfo.Job)</td>
                                    </tr>
                                    <tr>
                                        <td>工作单位地址:</td>
                                        <td colspan="5" id="workAddress">
                                            @if (Model.WorkInfo == null)
                                            {
                                                @Html.Raw("没有填写")
                                            }
                                            else
                                            {
                                                @Html.HiddenFor(m => m.WorkInfo.ProvincialID)
                                                @Html.HiddenFor(m => m.WorkInfo.CountyID)
                                                @Html.HiddenFor(m => m.WorkInfo.CityID)
                                                @Html.HiddenFor(m => m.WorkInfo.AreaName)
                                            }

                                        </td>
                                    </tr>
                                }
                                else
                                {
                                    <tr>
                                        <td colspan="6">没有填写</td>
                                    </tr>      
                                                                      
                                }
                                <tr>
                                    <td colspan="6" class="catelog">联系人信息
                                    </td>
                                </tr>
                                @if (Model.ContactInfo != null)
                                {
                                    <tr>
                                        <td>家庭联系人姓名:</td>
                                        <td>@(Model.ContactInfo == null ? "没有填写" : Model.ContactInfo.FamilyContact)</td>
                                        <td>关系:</td>
                                        <td>@(Model.ContactInfo == null ? "没有填写" : ((FamilyMemberType)Model.ContactInfo.FamilyRelation.GetValueOrDefault()).GetDisplayName())</td>
                                        <td>联系电话:</td>
                                        <td>@(Model.ContactInfo == null ? "没有填写" : Model.ContactInfo.FamilyPhone)</td>
                                    </tr>
                                    <tr>
                                        <td>工作联系人姓名:</td>
                                        <td>@(Model.ContactInfo == null ? "没有填写" : Model.ContactInfo.WorkContact)</td>
                                        <td>关系:</td>
                                        <td>@(Model.ContactInfo == null ? "没有填写" : ((WorkContact)Model.ContactInfo.WorkRelation.GetValueOrDefault()).GetDisplayName())</td>
                                        <td>联系电话:</td>
                                        <td>@(Model.ContactInfo == null ? "没有填写" : Model.ContactInfo.WorkPhone)</td>
                                    </tr>
                                    <tr>
                                        <td>其它联系人姓名:</td>
                                        <td>@(Model.ContactInfo == null ? "没有填写" : Model.ContactInfo.OtherContact)</td>
                                        <td>关系:</td>
                                        <td>@(Model.ContactInfo == null ? "没有填写" : ((OtherContact)Model.ContactInfo.OtherRelation.GetValueOrDefault()).GetDisplayName())</td>
                                        <td>联系电话:</td>
                                        <td>@(Model.ContactInfo == null ? "没有填写" : Model.ContactInfo.OtherPhone)</td>
                                    </tr>
                                }
                                else
                                {
                                    <tr>
                                        <td colspan="6">没有填写</td>
                                    </tr>      
                                                                      
                                }




                                <tr>
                                    <td colspan="6" class="catelog">附件信息</td>
                                </tr>
                                @if (Model.AccountAuthentication != null)
                                {
                                    <tr>
                                        <td>身份证:</td>
                                        <td id="IDCardUrl">
                                            <script>showAttachmentALink("@Model.AccountAuthentication.IDCardUrl", "IDCardUrl", "身份证", "attachmentAlink")</script>
                                        </td>
                                        <td>银行工资卡流水:</td>
                                        <td id="JobUrl">
                                            <script>showAttachmentALink("@Model.AccountAuthentication.JobUrl", "JobUrl", "银行工资卡流水", "attachmentAlink")</script>
                                        </td>
                                        <td>个人信用报告:</td>
                                        <td id="CreditReportUrl">
                                            <script>showAttachmentALink("@Model.AccountAuthentication.CreditReportUrl", "CreditReportUrl", "个人信用报告", "attachmentAlink")</script>
                                        </td>

                                    </tr>
                                    <tr>
                                        <td>收入证明:</td>
                                        <td id="HomeUrl">
                                            <script>showAttachmentALink("@Model.AccountAuthentication.HomeUrl", "HomeUrl", "住址证明", "attachmentAlink")</script>
                                        </td>
                                        <td>个人贷款抵押证明:</td>
                                        <td id="WorkUrl">
                                            <script>showAttachmentALink("@Model.AccountAuthentication.WorkUrl", "WorkUrl", "工作证明", "attachmentAlink")</script>
                                        </td>
                                        <td id="HeadUrl">
                                            <script>showAttachmentALink("@Model.AccountAuthentication.HeadUrl", "HeadUrl", "个人头像", "attachmentAlink")</script>
                                        </td>
                                    </tr>
                                }
                                else
                                {
                                    <tr>
                                        <td colspan="6">没有填写</td>
                                    </tr>   
                                }
                            </table>
                            @Html.Hidden("state")
                            @if (Model.Status==(int)AccountState.LookThrough)
                            {
                                @Html.Hidden("Pass", (int)AccountState.Pass)
                                @Html.Hidden("unfinished", (int)AccountState.Unfit)
                                <button id="PassBtn" class="btn btn-toFinancing  mt10 mr5">审核通过</button>
                                <button id="unfinishedBtn" class="btn btn-toCancel  mt10 mr5">审核不通过</button>
                            }
                            <a id="BackBtn" class="btn btn-default  mt10">返回</a>
                        </div>
                    </div>
                </div>
            }


        </div>
    </div>
    <div class="main_loan_bottom"></div>
</div>
